import 'package:jyofservice/bean/order_type_entity.dart';

orderTypeEntityFromJson(OrderTypeEntity data, Map<String, dynamic> json) {
	if (json['Code'] != null) {
		data.code = json['Code'].toString();
	}
	if (json['Msg'] != null) {
		data.msg = json['Msg'].toString();
	}
	if (json['Data'] != null) {
		data.data = OrderTypeData().fromJson(json['Data']);
	}
	return data;
}

Map<String, dynamic> orderTypeEntityToJson(OrderTypeEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['Code'] = entity.code;
	data['Msg'] = entity.msg;
	data['Data'] = entity.data?.toJson();
	return data;
}

orderTypeDataFromJson(OrderTypeData data, Map<String, dynamic> json) {
	if (json['count'] != null) {
		data.count = json['count'].toString();
	}
	if (json['data'] != null) {
		data.data = (json['data'] as List).map((v) => OrderTypeDataData().fromJson(v)).toList();
	}
	return data;
}

Map<String, dynamic> orderTypeDataToJson(OrderTypeData entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['count'] = entity.count;
	data['data'] =  entity.data?.map((v) => v!.toJson())?.toList();
	return data;
}

orderTypeDataDataFromJson(OrderTypeDataData data, Map<String, dynamic> json) {
	if (json['ID'] != null) {
		data.iD = json['ID'] is String
				? int.tryParse(json['ID'])
				: json['ID'].toInt();
	}
	if (json['Sqlx_id'] != null) {
		data.sqlxId = json['Sqlx_id'];
	}
	if (json['TypeName'] != null) {
		data.typeName = json['TypeName'].toString();
	}
	if (json['Mr_time'] != null) {
		data.mrTime = json['Mr_time'] is String
				? double.tryParse(json['Mr_time'])
				: json['Mr_time'].toDouble();
	}
	if (json['Import_lev'] != null) {
		data.importLev = json['Import_lev'] is String
				? int.tryParse(json['Import_lev'])
				: json['Import_lev'].toInt();
	}
	if (json['Ifcw'] != null) {
		data.ifcw = json['Ifcw'];
	}
	if (json['Flag'] != null) {
		data.flag = json['Flag'] is String
				? int.tryParse(json['Flag'])
				: json['Flag'].toInt();
	}
	if (json['CreateDate'] != null) {
		data.createDate = json['CreateDate'].toString();
	}
	if (json['CreateUserId'] != null) {
		data.createUserId = json['CreateUserId'] is String
				? int.tryParse(json['CreateUserId'])
				: json['CreateUserId'].toInt();
	}
	if (json['UpdateDate'] != null) {
		data.updateDate = json['UpdateDate'].toString();
	}
	if (json['UpdateUserId'] != null) {
		data.updateUserId = json['UpdateUserId'] is String
				? int.tryParse(json['UpdateUserId'])
				: json['UpdateUserId'].toInt();
	}
	if (json['OrderNo'] != null) {
		data.orderNo = json['OrderNo'] is String
				? int.tryParse(json['OrderNo'])
				: json['OrderNo'].toInt();
	}
	if (json['Sqlx_name'] != null) {
		data.sqlxName = json['Sqlx_name'];
	}
	if (json['Import_name'] != null) {
		data.importName = json['Import_name'].toString();
	}
	if (json['Ifcw_name'] != null) {
		data.ifcwName = json['Ifcw_name'];
	}
	return data;
}

Map<String, dynamic> orderTypeDataDataToJson(OrderTypeDataData entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['ID'] = entity.iD;
	data['Sqlx_id'] = entity.sqlxId;
	data['TypeName'] = entity.typeName;
	data['Mr_time'] = entity.mrTime;
	data['Import_lev'] = entity.importLev;
	data['Ifcw'] = entity.ifcw;
	data['Flag'] = entity.flag;
	data['CreateDate'] = entity.createDate;
	data['CreateUserId'] = entity.createUserId;
	data['UpdateDate'] = entity.updateDate;
	data['UpdateUserId'] = entity.updateUserId;
	data['OrderNo'] = entity.orderNo;
	data['Sqlx_name'] = entity.sqlxName;
	data['Import_name'] = entity.importName;
	data['Ifcw_name'] = entity.ifcwName;
	return data;
}